home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / db / esm-3.1 / esm-3 / usr / local / sm / src / include / BT_Log.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-05  |  2.9 KB  |  146 lines

  1. #ifndef _BT_LOG_H_
  2. #define _BT_LOG_H_
  3. /*
  4.  *   $RCSfile: BT_Log.h,v $  
  5.  *   $Revision: 1.1.1.1 $  
  6.  *   $Date: 1996/05/04 21:55:07 $      
  7.  */ 
  8. #ifndef __BT_LOG_H__
  9. #define __BT_LOG_H__
  10.  
  11.  
  12. struct LogBtreePageInitData {
  13.         TWO            newLevel;
  14.         SMDATATYPE    keyType;
  15.         
  16.         int Size()    { return sizeof(*this); }
  17.         };
  18.  
  19. struct LogBtreeModifyLinkData {
  20.         SHORTPID     oldNext;
  21.         SHORTPID    newNext;
  22.         SHORTPID    oldPrev;
  23.         SHORTPID    newPrev;
  24.         
  25.         int Size()    { return sizeof(*this); }
  26.         };
  27.         
  28. struct LogBtreeModifyVector0Data {
  29.         SHORTPID    oldPid0;
  30.         SHORTPID    newPid0;
  31.         
  32.         int Size()    { return sizeof(*this); }
  33.         };
  34.         
  35. struct LogBtreeModifyLevelData {
  36.         TWO            oldLevel;
  37.         TWO            newLevel;
  38.         
  39.         int Size()    { return sizeof(*this); }
  40.         };
  41.  
  42. // #define BTOFFSET(rec, field)    (((char*) &(rec->field)) - (char*) rec)
  43.  
  44. struct LogBtreePhysicInsertData {
  45.         TWO            startSlot;
  46.         TWO            numSlots;
  47.         FOUR        length;
  48.         char        data[1];
  49.         
  50.         int Size()    { return data + length - (char*) this; }
  51.         int Max()    { return BTREE_PAGESIZE - (data - (char*) this) - ALIGNSIZE(sizeof(LOGRECORDHDR)) - (2*ALIGNSIZE(sizeof(LOGPAGEHDR))); }
  52.         };
  53.  
  54. typedef LogBtreePhysicInsertData LogBtreePhysicDeleteData;
  55.         
  56.         
  57. struct LogBtreeLogicInsertData {
  58.         PID            rootPid;
  59.         TWO            elSize;
  60.         TWO            maxKeyLen;
  61.         TWO            unique;
  62.         TWO            keyLen;
  63.         SMDATATYPE    keyType;
  64.         char        data[1];
  65.         
  66.         int Size()    { return data + ALIGNSIZE(keyLen) + elSize 
  67.                                                         - (char*) this; }
  68.         void* Key() { return data; }
  69.         void* El()    { return data + ALIGNSIZE(keyLen); }
  70.         };
  71.  
  72. typedef LogBtreeLogicInsertData LogBtreeLogicDeleteData;
  73.  
  74. struct LogBtreeLogicIncrElCntData {
  75.         PID            rootPid;
  76.         TWO            maxKeyLen;
  77.         TWO            keyLen;
  78.         SMDATATYPE    keyType;
  79.         char        key[1];
  80.         
  81.         int Size()    { return key + keyLen - (char*) this; }        
  82.         };
  83.         
  84. typedef LogBtreeLogicIncrElCntData LogBtreeLogicDecrElCntData;
  85.  
  86. struct LogBtreeLogicSetOverflowData {
  87.         PID            rootPid;
  88.         PID            ovPid;
  89.         TWO            maxKeyLen;
  90.         TWO            keyLen;
  91.         TWO            numEl;
  92.         TWO            elSize;
  93.         SMDATATYPE    keyType;
  94.         char        data[1];
  95.         
  96.         int Size()    { return data + keyLen + 
  97.                                 numEl*elSize - (char*)this; }
  98.         char*     KeyValue()    { return data; }
  99.         char*     ElList()    { return data + keyLen; }
  100.         };
  101.  
  102. typedef LogBtreeLogicSetOverflowData LogBtreeLogicResetOverflowData;
  103.  
  104.  
  105. struct LogBtOvPageInitData {
  106.         TWO            elSize;
  107.         
  108.         int Size()    { return sizeof(*this); }
  109.         };        
  110.  
  111. struct LogBtOvModifyNextLink {
  112.         PID            rootPid;
  113.         SHORTPID    oldNext;
  114.         SHORTPID    newNext;
  115.         
  116.         int Size()    { return sizeof(*this); }
  117.         };
  118.  
  119. struct LogBtOvModifyPrevLink {
  120.         PID            rootPid;
  121.         SHORTPID    oldPrev;
  122.         SHORTPID    newPrev;
  123.         
  124.         int Size()    { return sizeof(*this); }
  125.         };
  126.  
  127.  
  128. struct LogBtOvInsert {
  129.         PID            rootPid;
  130.         TWO            startSlot;
  131.         TWO            numSlots;
  132.         TWO            elSize;
  133.         char        data[1];
  134.         
  135.         int Size()    { return (data + elSize * numSlots) - (char*) this; }
  136.         int Max()    { return BTREE_PAGESIZE - 
  137.                                 (data - (char*) this) - 100; }
  138.         };
  139.  
  140. typedef LogBtOvInsert LogBtOvDelete;
  141.  
  142.         
  143.  
  144. #endif /* __BT_LOG_H__ */
  145. #endif /* _BT_LOG_H_ */
  146.